package com.huluobo.a2203kotlinjetpackdemo.paging

import androidx.paging.PagingSource
import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update

/**
 *  Created by LC on 2024/7/23.
 */
@Dao
interface BeanDao {
    @Query("select * from bean_info")
    fun queryBean(): PagingSource<Int, Bean>

    @Query("delete from bean_info")
    suspend fun clear()

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insert(list: List<Bean>)

    @Delete
    fun deleteBean(bean: Bean)

    @Update
    fun updateBean(bean: Bean)
}